// 防抖
function debounce (fn, delay) {
    let timer = null;
    return function() {
        const _this = this;
        const args = arguments;
        if (timer) {
            clearTimeout(timer);
        }
        timer = setTimeout(() => {
            timer = null;
            fn.apply(this, args)
        }, delay);
    }
}

export default debounce;

